package com.meowcook.mapper;

import com.meowcook.pojo.po.Board;
import com.meowcook.pojo.vo.BoardVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 28792
 * Date: 2025-05-15
 * Time: 18:59
 */
@Mapper(componentModel = "spring")
public interface BoardPojoMapper {
    BoardPojoMapper INSTANCE = Mappers.getMapper(BoardPojoMapper.class);

    @Mapping(source = "board.id", target = "id")
    @Mapping(source = "board.name", target = "name")
    @Mapping(source = "board.recipeCount", target = "recipeCount")
    @Mapping(source = "board.description", target = "description")
    BoardVO toVO(Board board);
}
